package com.wyk.controller;

import com.wyk.domain.CommonResult;
import com.wyk.domain.Order;
import com.wyk.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WangYuKai
 * @Date 2022/8/4
 * @apiNote
 */
@RestController
public class OrderController {
    //注入service
    @Autowired
    private OrderService orderService;

    @GetMapping("/order/create")
    public CommonResult addOrder(Order order){
        int i = orderService.addOrder(order);
        if(i != 0){
            return new CommonResult(200,"创建成功");
        }else{
            return new CommonResult(500,"创建失败");
        }
    }
}
